
# todo 1、解压
[bwie@node103 ~]$ rz
  datax-web-2.1.2.tar.gz
[bwie@node103 ~]$ tar -zxvf datax-web-2.1.2.tar.gz -C /opt/module
[bwie@node103 module]$ mv /opt/module/datax-web-2.1.2/ /opt/module/datax-web

# todo 2、创建数据库
[bwie@node103 ~]$ mysql -uroot -p123456
mysql> CREATE DATABASE datax_web DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
mysql> USE datax_web;
mysql> SOURCE /opt/module/datax-web/bin/db/datax_web.sql;
mysql> SHOW TABLES;


# todo 3、安装部署
# 3.1 一键部署
[bwie@node103 ~]$ cd /opt/module/datax-web/
[bwie@node103 datax-web]$ bin/install.sh
    2024-12-27 18:24:55.492 [INFO] (8394) Creating directory: [/opt/module/datax-web/bin/../modules].
    2024-12-27 18:24:55.497 [INFO] (8394)  ####### Start To Uncompress Packages ######
    2024-12-27 18:24:55.500 [INFO] (8394) Uncompressing....
Do you want to decompress this package: [datax-admin_2.1.2_1.tar.gz]? (Y/N)Y
  输入：Y
2024-12-27 18:24:59.449 [INFO] (8394)  Uncompress package: [datax-admin_2.1.2_1.tar.gz] to modules directory
Do you want to decompress this package: [datax-executor_2.1.2_1.tar.gz]? (Y/N)Y
  输入：Y
2024-12-27 18:25:06.176 [INFO] (8394)  Uncompress package: [datax-executor_2.1.2_1.tar.gz] to modules directory
2024-12-27 18:25:06.632 [INFO] (8394)  ####### Finish To Umcompress Packages ######
Scan modules directory: [/opt/module/datax-web/bin/../modules] to find server under dataxweb
2024-12-27 18:25:06.639 [INFO] (8394)  ####### Start To Install Modules ######
2024-12-27 18:25:06.642 [INFO] (8394) Module servers could be installed:
 [datax-admin]  [datax-executor]
Do you want to confiugre and install [datax-admin]? (Y/N)Y
  输入：Y
2024-12-27 18:25:08.599 [INFO] (8394)  Install module server: [datax-admin]
Start to make directory
2024-12-27 18:25:08.652 [INFO] (8436)  Start to build directory
2024-12-27 18:25:08.654 [INFO] (8436) Creating directory: [/opt/module/datax-web/modules/datax-admin/bin/../logs].
2024-12-27 18:25:08.685 [INFO] (8436) Directory or file: [/opt/module/datax-web/modules/datax-admin/bin/../conf] has been exist
2024-12-27 18:25:08.687 [INFO] (8436) Creating directory: [/opt/module/datax-web/modules/datax-admin/bin/../data].
end to make directory
Start to initalize database
2024-12-27 18:25:08.741 [INFO] (8436)  Scan out mysql command, so begin to initalize the database
Do you want to initalize database with sql: [/opt/module/datax-web/bin/db/datax_web.sql]? (Y/N)Y
  输入：Y
Please input the db host(default: 127.0.0.1): node103
  输入MySQL数据库地址：node103
Please input the db port(default: 3306): 3306
  输入MySQL数据库端口号：3306
Please input the db username(default: root): root
  输入MySQL数据库用户名：root
Please input the db password(default: ): 123456
  输入MySQL数据库密码：123456
Please input the db name(default: dataxweb)datax_web
  输入MySQL数据库DataBase名称：datax_web
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-web' at line 1
Do you want to confiugre and install [datax-executor]? (Y/N)Y
  输入：Y
2024-12-27 18:25:31.348 [INFO] (8394)  Install module server: [datax-executor]
    2024-12-27 18:25:31.369 [INFO] (8493)  Start to build directory
2024-12-27 18:25:31.372 [INFO] (8493) Creating directory: [/opt/module/datax-web/modules/datax-executor/bin/../logs].
2024-12-27 18:25:31.399 [INFO] (8493) Directory or file: [/opt/module/datax-web/modules/datax-executor/bin/../conf] has been exist
2024-12-27 18:25:31.401 [INFO] (8493) Creating directory: [/opt/module/datax-web/modules/datax-executor/bin/../data].
2024-12-27 18:25:31.428 [INFO] (8493) Creating directory: [/opt/module/datax-web/modules/datax-executor/bin/../json].
2024-12-27 18:25:31.454 [INFO] (8394)  ####### Finish To Install Modules ######


# 3.2 修改配置文件
[bwie@node103 ~]$ cd /opt/module/datax-web/modules/datax-admin/conf/
[bwie@node103 conf]$ vim bootstrap.properties
  修改内容：
    #Database
    DB_HOST=node103
    DB_PORT=3306
    DB_USERNAME=root
    DB_PASSWORD=123456
    DB_DATABASE=datax_web


[bwie@node103 ~]$ cd /opt/module/datax-web/modules/datax-admin/bin
[bwie@node103 bin]$ vim env.properties
  修改内容：
  # mail account
  MAIL_USERNAME="javalinux@126.com"
  MAIL_PASSWORD="xxxxxxxxxx"


[bwie@node103 ~]$ cd /opt/module/datax-web/modules/datax-executor/bin
[bwie@node103 bin]$ vim env.properties
  修改内容：
  ## PYTHON脚本执行位置
  #PYTHON_PATH=/home/hadoop/install/datax/bin/datax.py
  PYTHON_PATH=/opt/module/datax/bin/datax.py


# 4. 启动
[bwie@node103 ~]$ cd /opt/module/datax-web
[bwie@node103 datax-web]$ bin/start-all.sh
2024-12-27 18:47:17.684 [INFO] (9972)  Try To Start Modules In Order
2024-12-27 18:47:17.691 [INFO] (9980)  ####### Begin To Start Module: [datax-admin] ######
2024-12-27 18:47:17.699 [INFO] (9988) load environment variables
2024-12-27 18:47:17.969 [INFO] (9988) /opt/module/jdk/bin/java
2024-12-27 18:47:17.971 [INFO] (9988) Waiting DATAX-ADMIN to start complete ...
2024-12-27 18:47:18.148 [INFO] (9988) DATAX-ADMIN start success
2024-12-27 18:47:18.159 [INFO] (10183)  ####### Begin To Start Module: [datax-executor] ######
2024-12-27 18:47:18.166 [INFO] (10191) load environment variables
2024-12-27 18:47:18.515 [INFO] (10191) /opt/module/jdk/bin/java
2024-12-27 18:47:18.519 [INFO] (10191) Waiting DATAX-EXEXUTOR to start complete ...
2024-12-27 18:47:18.730 [INFO] (10191) DATAX-EXEXUTOR start success


[bwie@node103 datax-web]$ bin/stop-all.sh
2024-12-27 18:46:57.263 [INFO] (9468)  Try to Stop Modules In Order
2024-12-27 18:46:57.272 [INFO] (9476)  ####### Begin To Stop Module: [datax-admin] ######
2024-12-27 18:46:57.279 [INFO] (9484) load environment variables
2024-12-27 18:46:57.630 [INFO] (9484) Killing DATAX-ADMIN (pid 8899) ...
2024-12-27 18:46:57.635 [INFO] (9484) Waiting DATAX-ADMIN to stop complete ...
2024-12-27 18:46:59.990 [INFO] (9484) DATAX-ADMIN stop success
2024-12-27 18:46:59.997 [INFO] (9690)  ####### Begin To Stop Module: [datax-executor] ######
2024-12-27 18:47:00.005 [INFO] (9698) load environment variables
2024-12-27 18:47:00.311 [INFO] (9698) Killing DATAX-EXEXUTOR (pid 9165) ...
2024-12-27 18:47:00.314 [INFO] (9698) Waiting DATAX-EXEXUTOR to stop complete ...
2024-12-27 18:47:02.616 [INFO] (9698) DATAX-EXEXUTOR stop success


# 5.Web 界面登录
http://node103:9527/index.html
  admin/123456


# 6.异常解决
    [bwie@node103 datax-web]$ mysql -uroot -p123456
    mysql> use datax_web
  ## 6.1.datax-web任务模板报错 Unknown column 't.user_id' in 'field list'
    ### https://www.modb.pro/db/430558
    ### 手动执行此条语句：

    ALTER TABLE `job_info` CHANGE COLUMN `author` `user_id` INT(11) NOT NULL COMMENT '修改用户' ;

